<?php
    $arr_estado = array(1 => 'Activo', 2 => 'Inactivo');
    $arr_students_estados = array(0 => 'Borrado',1 => 'Inscripto',2 => 'Confirmado',3 => 'Regular',4 => 'No regular');
?>
<header>
    <div class="title">
        <a href="">Cursos</a><span> > </span><strong>Ver perfil curso</strong>
    </div>
    <div class="shortcuts">
        <a href=""></a>
    </div>
    <div class="help">
        <a href="">Ayuda</a>
    </div>
</header>
<div class="sidebar">
    <div id="group-read" class="content">
        <h3>Perfil curso</h3>
        <form id="group-read-form" action="#" method="post" enctype="multipart/form-data">
            <input name="form-action" type="hidden" value="read-group" />
            <div class="form-container">
                <strong class="title">Datos publicos del curso</strong>
                <div class="content">
                    <div class="form-fields">
                        <label>
                            <span class="name">Titulo:</span>
                            <input type="text" readonly id="group-create-form-titulo" name="titulo" value="<?php if ($group->get('grupos','titulo')) echo html_entity_decode($group->get('grupos','titulo')); ?>" placeholder="Sin datos" />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Descripcion (publica):</span>
                            <textarea id="group-create-form-descripcion-publica" disabled name="descripcion_publica" placeholder="Sin datos"><?php if ($group->get('grupos','descripcion_publica')) echo html_entity_decode($group->get('grupos','descripcion_publica')); ?></textarea>
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Cupo minimo:</span>
                            <input type="text" readonly id="group-create-form-cupo" name="cupo" value="<?php if ($group->get('grupos','cupo_min')) echo html_entity_decode($group->get('grupos','cupo_min')); ?>" placeholder="Sin datos" />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Precio cuota:</span>
                            <input type="text" readonly id="group-create-form-precio" name="precio" value="<?php if ($group->get('grupos','precio_cuota')) echo html_entity_decode($group->get('grupos','precio_cuota')); ?>" placeholder="Sin datos" />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Clases por semana:</span>
                            <input type="text" readonly id="group-create-form-clasesxsemana" name="clasesxsemana" value="<?php if ($group->get('grupos','clasesxsemana')) echo html_entity_decode($group->get('grupos','clasesxsemana')); ?>" placeholder="Sin datos" />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Total de clases:</span>
                            <input type="text" readonly id="group-create-form-total" name="total_clases" value="<?php if ($group->get('grupos','total_clases')) echo html_entity_decode($group->get('grupos','total_clases')); ?>" placeholder="Sin datos" />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Promociones/Ofertas:</span>
                            <textarea id="group-create-form-promo" disabled name="promo" placeholder="Sin datos"><?php if ($group->get('grupos','promociones')) echo html_entity_decode($group->get('grupos','promociones')); ?></textarea>
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Dia/s:</span>
                            <input type="text" readonly id="group-create-form-dias" name="dias" value="<?php if ($group->get('calendario','dias')) echo html_entity_decode($group->get('calendario','dias')); ?>" placeholder="Sin datos" />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Horario:</span>
                            <input type="text" readonly id="group-create-form-horarios" name="horarios" value="<?php if ($group->get('calendario','horarios')) echo html_entity_decode($group->get('calendario','horarios')); ?>" placeholder="Sin datos"  />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Plan: </span>
                            <?php if ($group->get('grupos','plan')) echo '<a class="button" href='.$host.'plans/read/'.$group->get('grupos','fk_plan').'>'.html_entity_decode($group->get('grupos','plan')).'</a>';
                                 else echo '<input type="text" readonly placeholder="Sin datos" />'; ?>
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                    </div>
                </div>
            </div>
            <div class="form-container">
                <strong class="title">Datos privado del curso</strong>
                <div class="content">
                    <div class="form-fields">
                        <label>
                            <span class="name">Nombre:</span>
                            <input readonly type="text" id="group-read-form-nombre" name="nombre" value="<?php if ($group->get('grupos','nombre')) echo html_entity_decode($group->get('grupos','nombre')); ?>" placeholder="Sin datos." />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Descripcion:</span>
                            <textarea disabled name='descripcion'><?php if ($group->get('grupos','descripcion')) echo html_entity_decode($group->get('grupos','descripcion')); ?> </textarea>
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                        <label>
                            <span class="name">Estado:</span>
                            <input readonly type="text" id="group-read-form-nombre" name="estado" value="<?php if ($group->get('grupos','estado')) echo $arr_estado[html_entity_decode($group->get('grupos','estado'))]; ?>" placeholder="Sin datos." />
                            <span class="help" data-text="Depending on project settings weekend may be included in due date calculation"></span>
                        </label>
                    </div>
                </div>
            </div>
            <?php if (count($arr_students)>0) { ?>
                <div class="form-container">
                    <strong class="title">Alumnos del curso</strong>
                    <div class="content">
                        <div class="form-table">
                            <table>
                                <thead>
                                    <tr>
                                        <th>Alumno</th>
                                        <th>Estado</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php foreach ($arr_students as $student) { ?>
                                    <tr data-variables="<?php echo $student['id'].','.$student['nombre'].','.$student['email'].',read'; ?>">
                                        <td><img src="http://localhost/cov/sai/test/content/lol.png" alt="" class="size-16x16" />
                                            <?php echo $student['nombre']; ?>(<?php echo $student['email']; ?>)</td>
                                        <td><?php echo $arr_students_estados[$student['estado']]; ?></td>
                                    </tr>
                                    <?php } ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            <?php } ?>
            <div class="form-buttons">
                <a class="button important blue" href="<?php echo $host . 'groups/update/'.$glb_uri[2]; ?>"><span class="icon pencil"></span> Editar info</a>
                <a class="button important blue" href="<?php echo $host . 'groups/update-students/'.$glb_uri[2]; ?>">+/- Alumnos</a>
                <a class="button important red" href="<?php echo $host . 'groups/delete/'.$glb_uri[2]; ?>"><span class="icon trash"></span> Borrar</a>
                <a class="button" href="<?php echo $host . 'groups/'; ?>"><span class="icon list"></span> Volver al listado</a>
            </div>
        </form>
    </div>
</div>